package com.zd.shopping.viewholder;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.zd.shopping.R;
import com.zd.shopping.bean.WmOmNoticeHEntity;
import com.zd.shopping.bean.WmTmsNoticeHEntity;
import com.zd.shopping.utils.RouterUtils;
import com.zwz.mall.listener.OnItemClickListener;
import com.zwz.mall.utils.ToastUtils;
import com.zwz.mall.viewholder.BaseViewHolder;

import butterknife.BindView;

/**
 * Created by 张默默 on 2020/3/13.
 */

public class DeliverGoodsViewHodler extends BaseViewHolder {
    @BindView(R.id.tv_state)
    TextView mTvstate;
    @BindView(R.id.tv_delvMember)
    TextView mTvdelvMember;
    @BindView(R.id.tv_delvMobile)
    TextView mTvdelvMobile;
    @BindView(R.id.tv_delvAddr)
    TextView mTvdelvAddr;
    public OnItemClickListener onItemClickListener;
    public  DeliverGoodsViewHodler(View itemView) {
        super (itemView);
    }

    @Override
    public void bindView(int position, Object obj, Context context) {
        if (obj instanceof WmTmsNoticeHEntity){
            WmTmsNoticeHEntity wmTmsNoticeHEntity = (WmTmsNoticeHEntity) obj;
            mTvstate.setText (wmTmsNoticeHEntity.getOmSta ());
            mTvdelvMember.setText (wmTmsNoticeHEntity.getDelvMember ());
            mTvdelvMobile.setText (wmTmsNoticeHEntity.getDelvMobile ());
            mTvdelvAddr.setText ("联系地址:"+wmTmsNoticeHEntity.getDelvAddr ());
            itemView.setOnClickListener (new View.OnClickListener () {
                @Override
                public void onClick(View view) {
//                    ToastUtils.showShort (wmTmsNoticeHEntity.getOmNoticeId ());
                    RouterUtils.openDeliverDetailsActivity (mContext,wmTmsNoticeHEntity.getOmNoticeId ());
                }
            });
        }
    }
}
